import styled from 'styled-components';
import logoimg from '../../statics/imgs/logo.png';

export const HeaderWrap = styled.div`
    border-bottom: 1px solid #f0f0f0;
    height: 58px;
`;

export const Inner = styled.div`
    position: relative;
    width: 1440px;
    height: 100%;
    margin: 0 auto;
    border-bottom: 1px solid #f1f1f1;
`;

export const Nav = styled.div`
    width: 960px;
    height: 100%;
    margin: 0 auto;
`;

export const Logo = styled.div`
    width: 100px;
    height: 56px;
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -28px;
    cursor: pointer;
    background: url(${logoimg});
    background-size: contain;
`;

export const NavItem = styled.div`
    
    cursor: pointer;
    line-height: 58px;
    padding-right: 30px;
    color: #333;
    
    &.left {
        font-size: 17px;
        float: left;
    }
    
    &.right {
        font-size: 15px;
        float: right;
        color: #969696;
        .iconfont {
            font-size: 24px;
        }
    }
    
    &.active {
        color: #ea6f5a;
    }
    
    .iconfont {
        margin-right: 5px;
    }
    
    
`;

export const SearchWrap = styled.div`
    position: relative;
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    border-radius: 19px;
    background: #eee;
    float: left;
    margin: 10px;
    padding: 0 42px 0 20px;
    
    .iconsearch {
        width: 30px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        position: absolute;
        right: 10px;
        font-size: 18px;
        top: 50%;
        margin-top: -15px;
        border-radius: 50%;
        cursor: pointer;
        transition: .2s;
        
        &.focused {
            background: #666;
            color: #f2f2f2;
            transition: .2s;
        }
    }
`;

export const NavSearch = styled.input.attrs({
    placeholder: '搜索'
})`
    width: 160px;
    border: none;
    outline: none;
    background: transparent;
    transition: .6s;
    
    &::placeholder {
        color: #999;
    }
    
    &.focused {
        width: 220px;
        transition: .6s;
    }
`;

export const Addition = styled.div`
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
`;

export const Button = styled.button`
    display: block;
    float: right;
    height: 38px;
    border-radius: 19px;
    outline: none;
    margin: 10px;
    border: 1px solid #ea6f5a;
    cursor: pointer;
    font-size: 15px;
    
    &.write {
        background: #ea6f5a;
        width: 100px;
        color: #fff;
        .iconfont {
            margin-right: 5px;
        }
    }
    
    &.reg {
        background: transparent;
        color: #ea6f5a;
        width: 80px;
    }
`;

export const SearchInfo = styled.div`
    position: absolute;
    top: 56px;
    left: 0;
    width: 200px;
    padding: 10px 20px;
    box-shadow: 0 0 8px rgba(0, 0, 0, .2);
    background: #fff;
    border-radius: 4px;
    
    &::before {
        position: absolute;
        content: "";
        left: 27px;
        width: 10px;
        height: 10px;
        transform: rotate(45deg);
        top: -5px;
        z-index: -1;
        background: #fff;
        box-shadow: 0 0 8px rgba(0,0,0,.2);
    }
    
    &::after {
        content: "";
        position: absolute;
        width: 0;
        height: 0;
        border: 12px solid transparent;
        border-bottom-color: #fff;
        left: 20px;
        top: -23px;
    }
`;

export const SearchInfoTitle = styled.span`
    color: #969696;
    display: block;
    height: 27px;
    line-height: 27px;
    font-size: 14px;
`;

export const SearchInfoList = styled.div`
    overflow: hidden;
    margin-top: 10px;
`;

export const SearchInfoSwitch = styled.span`
    float: right;
    color: #969696;
    cursor: pointer;
    user-select: none;
    position: relative;
    font-size: 13px;
    
    .iconspin {
        display: inline-block;
        font-size: 13px;
        line-height: 1;
        margin-right: 5px;
        transition: .6s;
        transform-origin: center center;
    }

`;

export const SearchInfoItem = styled.a`
    float: left;
    font-size: 12px;
    line-height: 20px;
    border: 1px solid #eee;
    color: #969696;
    cursor: pointer;
    border-radius: 2px;
    display: block;
    padding: 0 5px;
    margin: 0 10px 10px 0;
    
    &:hover {
        border: 1px solid #ccc;
    }
`;
